package com.YK.retryer.proxy;

import org.springframework.cglib.proxy.Enhancer;

/**
 * @author yuank
 * @version 1.0.0
 * @date 2025/2/28 16:20:28
 *
 * 用于创建代理 项目与cglib解耦
 *
 */
public class BeanMethodRetryProxyFactory {

    public static Object createdProxy(Object target, BeanMethodRetryProxy retryerProxy){
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(target.getClass());
        enhancer.setCallback(retryerProxy);
        return enhancer.create();
    }

}